﻿using System;
using System.Collections.Generic;
using System.Reflection;

using Matchingo.Common.Types.Interfaces;

namespace Matchingo.Models.DefaultImageSetResources
{
    public class CardSetResources : ICardSetResources
    {
        // URI path is made up of AssemblyName, SubFolder, Filename
        private const string URI_PATH = "/{0};component/{1}/{2}";

		private const string SET_NAME_NETHERLANDS = "Netherlands";
		private const string SET_NAME_ATLANTA_ZOO = "Atlanta Zoo";
		private const string SET_NAME_KEUKENHOF_GARDENS = "Keukenhof Gardens";

		private const string FOLDER_NETHERLANDS_CARDS = "Netherlands_Cards";
        private const string FOLDER_ATLANTA_ZOO_CARDS = "AtlantaZoo_Cards";
        private const string FOLDER_KEUKENHOF_GARDENS_CARDS = "KeukenhofGardens_Cards";       

        public List<string> GetCardSetNames()
        {
            List<string> cardSets = new List<string>();
			cardSets.Add(SET_NAME_ATLANTA_ZOO);
			cardSets.Add(SET_NAME_KEUKENHOF_GARDENS);
			cardSets.Add(SET_NAME_NETHERLANDS);

            return cardSets;
        }

        public Dictionary<string, List<Uri>> GetCardSetsProvided()
        {			
			Dictionary<string, List<Uri>> cardSets = new Dictionary<string, List<Uri>>();

            // this provider has 3 sets - Netherlands, AtlantaZoo, KeukenhofGardens
            
            // netherlands
			List<Uri> netherlandsCards = new List<Uri>()
                {
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "DSCN0003.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "DSCN0193.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "DSCN0207.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "DSCN0248.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "DSCN0273.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "DSCN0282.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "DSCN0290.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "DSCN0293.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "DSCN0325.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "DSCN0330.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "DSCN0333.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "DSCN0336.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "DSCN0339.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "DSCN0344.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "DSCN0362.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "DSCN0436.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1040985.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1040998.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1050006.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1050014.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1050020.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1050126.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1050185.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1050197.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1050223.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1050270.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1050275.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1050286.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1050293.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1050303.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1050308.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1050343.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1050390.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1050455.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1050459.jpg"),
                    FormatUri(FOLDER_NETHERLANDS_CARDS, "P1050848.jpg")
                };

            // AtlantaZoo
			List<Uri> atlantaZooCards = new List<Uri>()
                {
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "DSC00192.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "DSC00196.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000336.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000339.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000365.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000389.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000403.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000415.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000417.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000435.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000481.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000489.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000492.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000494.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000570.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000611.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000618.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000705.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000707.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000713.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000714.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000726.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000727.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000741.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000754.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000817.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000850.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000874.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000886.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000906.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000917.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1000923.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1040038.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1040041.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1040096.jpg"),
                    FormatUri(FOLDER_ATLANTA_ZOO_CARDS, "P1040118.jpg"),
                };

            // KeukenhofGardens
			List<Uri> keukenhofGardensResources = new List<Uri>()
            {
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050645.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050652.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050655.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050661.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050662.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050666.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050669.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050670.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050677.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050678.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050683.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050685.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050686.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050691.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050692.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050695.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050701.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050702.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050704.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050708.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050710.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050711.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050712.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050716.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050725.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050734.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050735.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050736.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050737.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050738.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050741.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050742.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050744.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050745.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050746.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050748.jpg"),
                    FormatUri(FOLDER_KEUKENHOF_GARDENS_CARDS, "P1050749.jpg")
                };

			cardSets.Add(SET_NAME_ATLANTA_ZOO, atlantaZooCards);
			cardSets.Add(SET_NAME_KEUKENHOF_GARDENS, keukenhofGardensResources);
			cardSets.Add(SET_NAME_NETHERLANDS, netherlandsCards);			            

            return cardSets;
        }

        private static Uri FormatUri(string foldername, string filename)
        {
            string fullAssemblyName = Assembly.GetExecutingAssembly().ToString();
            string assemblyName = fullAssemblyName.Substring(0, fullAssemblyName.IndexOf(','));

            return new Uri(string.Format(URI_PATH, assemblyName, foldername, filename), UriKind.Relative);
        }

	}
}
